const parseRTF = require('../parser/index')
const fs = require('fs')

//https://www.npmjs.com/package/rtf-parser
//https://github.com/iarna/rtf-parser  代码地址

// https://www.npmjs.com/package/@iarna/rtf-to-html
//https://www.npmjs.com/package/rtf2md
//C:\Users\xue\Desktop\dashboard-rtf-file\rtf\node_modules\rtf2md

// const sBase64='R0lGODlhJQAlAJECAL3L2AYrTv///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgACACwAAAAAJQAlAAACi5SPqcvtDyGYIFpF690i8xUw3qJBwUlSadmcLqYmGQu6KDIeM13beGzYWWy3DlB4IYaMk+Dso2RWkFCfLPcRvFbZxFLUDTt21BW56TyjRep1e20+i+eYMR145W2eefj+6VFmgTQi+ECVY8iGxcg35phGo/iDFwlTyXWphwlm1imGRdcnuqhHeop6UAAAIfkEBQoAAgAsEAACAAQACwAAAgWMj6nLXAAh+QQFCgACACwVAAUACgALAAACFZQvgRi92dyJcVJlLobUdi8x4bIhBQAh+QQFCgACACwXABEADAADAAACBYyPqcsFACH5BAUKAAIALBUAFQAKAAsAAAITlGKZwWoMHYxqtmplxlNT7ixGAQAh+QQFCgACACwQABgABAALAAACBYyPqctcACH5BAUKAAIALAUAFQAKAAsAAAIVlC+BGL3Z3IlxUmUuhtR2LzHhsiEFACH5BAUKAAIALAEAEQAMAAMAAAIFjI+pywUAIfkEBQoAAgAsBQAFAAoACwAAAhOUYJnAagwdjGq2amXGU1PuLEYBACH5BAUKAAIALBAAAgAEAAsAAAIFhI+py1wAIfkEBQoAAgAsFQAFAAoACwAAAhWUL4AIvdnciXFSZS6G1HYvMeGyIQUAIfkEBQoAAgAsFwARAAwAAwAAAgWEj6nLBQAh+QQFCgACACwVABUACgALAAACE5RgmcBqDB2MarZqZcZTU+4sRgEAIfkEBQoAAgAsEAAYAAQACwAAAgWEj6nLXAAh+QQFCgACACwFABUACgALAAACFZQvgAi92dyJcVJlLobUdi8x4bIhBQAh+QQFCgACACwBABEADAADAAACBYSPqcsFADs='
// const b= Buffer.from(sBase64,'base64');
// const hex=b.toString('hex')
// console.log(hex);

const rtfFile = require('path').resolve(__dirname,'../../doc/','1.rtf') 



// ----------------------------------------------------------
/**/
parseRTF.stream(fs.createReadStream(rtfFile), (err, doc) => {
  console.log('-----------------------------------to rtf')
  // console.log(JSON.stringify(doc.content,null,4))
   console.log(doc)
})



const rtfToHTML = require('..//rtfToHtml/index');
const path = require('path');
rtfToHTML.fromStream(fs.createReadStream(rtfFile), (err, html) => {
  console.log('-----------------------------------to html')
  console.log(html)
})

